import 'package:taonile/generated/json/base/json_field.dart';
import 'package:taonile/generated/json/order_list_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class OrderListEntity {
  late int code = 0;
  late String msg;
  late List<OrderListData> data = [];

  OrderListEntity();

  factory OrderListEntity.fromJson(Map<String, dynamic> json) => $OrderListEntityFromJson(json);

  Map<String, dynamic> toJson() => $OrderListEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class OrderListData {
  late String id;
  @JSONField(name: "order_no")
  late String orderNo;
  late String status;
  @JSONField(name: "store_id")
  late String storeId;
  @JSONField(name: "pay_channel")
  late String payChannel;
  late String qdys;
  late String usdt;
  late String score;
  @JSONField(name: "created_at")
  late String createdAt;
  @JSONField(name: "freight_price")
  late String freightPrice;
  late String integral;
  @JSONField(name: "is_pay")
  late String isPay;
  late String tag = '1';
  @JSONField(name: "status_str")
  late String statusStr;

  @JSONField(name: "is_show_notice_send")
  late String isShowNoticeSend = '';

  @JSONField(name: "goods_count")
  late String goodsCount;
  late String money;
  late String money1;
  late String company;
  late String company1;
  @JSONField(name: "pay_channel_str")
  late String payChannelStr;
  @JSONField(name: "pay_money")
  late String payMoney;
  @JSONField(name: "pay_money1")
  late String payMoney1;
  @JSONField(name: "pay_company")
  late String payCompany;
  @JSONField(name: "pay_company1")
  late String payCompany1;
  late OrderListDataStore store;
  @JSONField(name: "order_goods")
  late List<OrderListDataOrderGoods> orderGoods = [];

  OrderListData();

  factory OrderListData.fromJson(Map<String, dynamic> json) => $OrderListDataFromJson(json);

  Map<String, dynamic> toJson() => $OrderListDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class OrderListDataStore {
  late String id;
  late String name;
  late String logo;

  OrderListDataStore();

  factory OrderListDataStore.fromJson(Map<String, dynamic> json) =>
      $OrderListDataStoreFromJson(json);

  Map<String, dynamic> toJson() => $OrderListDataStoreToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class OrderListDataOrderGoods {
  late String id;
  @JSONField(name: "order_no")
  late String orderNo;
  @JSONField(name: "sku_snap")
  late OrderListDataOrderGoodsSkuSnap skuSnap;
  @JSONField(name: "buy_num")
  late String buyNum;
  @JSONField(name: "all_price")
  late String allPrice;
  @JSONField(name: "all_integral")
  late String allIntegral;
  @JSONField(name: "unit_price")
  late String unitPrice;
  @JSONField(name: "unit_integral")
  late String unitIntegral;
  late String company;
  late String company1;
  late String money;
  late String money1;
  @JSONField(name: "status_detail")
  late String statusDetail = '';

  OrderListDataOrderGoods();

  factory OrderListDataOrderGoods.fromJson(Map<String, dynamic> json) =>
      $OrderListDataOrderGoodsFromJson(json);

  Map<String, dynamic> toJson() => $OrderListDataOrderGoodsToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class OrderListDataOrderGoodsSkuSnap {
  late String id;
  @JSONField(name: "spec_key")
  late List<String> specKey;
  @JSONField(name: "spec_val")
  late List<String> specVal;
  @JSONField(name: "img_path")
  late String imgPath;
  late OrderListDataOrderGoodsSkuSnapGoods goods;
  late List<OrderListDataOrderGoodsSkuSnapSpec> spec;

  OrderListDataOrderGoodsSkuSnap();

  factory OrderListDataOrderGoodsSkuSnap.fromJson(Map<String, dynamic> json) =>
      $OrderListDataOrderGoodsSkuSnapFromJson(json);

  Map<String, dynamic> toJson() => $OrderListDataOrderGoodsSkuSnapToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class OrderListDataOrderGoodsSkuSnapGoods {
  late String id;
  late String name;
  @JSONField(name: "store_id")
  late String storeId;
  @JSONField(name: "area_id")
  late String areaId;

  OrderListDataOrderGoodsSkuSnapGoods();

  factory OrderListDataOrderGoodsSkuSnapGoods.fromJson(Map<String, dynamic> json) =>
      $OrderListDataOrderGoodsSkuSnapGoodsFromJson(json);

  Map<String, dynamic> toJson() => $OrderListDataOrderGoodsSkuSnapGoodsToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class OrderListDataOrderGoodsSkuSnapSpec {
  late String name;
  late String val;

  OrderListDataOrderGoodsSkuSnapSpec();

  factory OrderListDataOrderGoodsSkuSnapSpec.fromJson(Map<String, dynamic> json) =>
      $OrderListDataOrderGoodsSkuSnapSpecFromJson(json);

  Map<String, dynamic> toJson() => $OrderListDataOrderGoodsSkuSnapSpecToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
